export function debounce(fn: Function, delay: number) {
    let timer: any = null;
    return function(...arg: any){
        timer && clearTimeout(timer)
        //@ts-ignore
        timer = setTimeout(() => {
            fn(...arg)
        }, delay);
    }
}